﻿<!DOCTYPE html>
<html ng-app="QuotingToolApp">
<head>
    <base href="/">
    <title></title>

    <script src="/Scripts/libs/jquery/jquery-1.11.3.min.js"></script>
    <script src="/Scripts/libs/angular/angular.js"></script>
    <script src="/Scripts/libs/angular/angular-resource.min.js"></script>
    <script src="/Scripts/libs/angular/angular-sanitize.min.js"></script>
    <script src="/Scripts/libs/angular/angular-animate.min.js"></script>
    <script src="/Scripts/libs/bootstrap/bootstrap.min.js"></script>
    <script src="/Scripts/libs/bootstrap/ui-bootstrap-tpls-1.3.3.min.js"></script>
    <script src="/Scripts/libs/smart-table/smart-table.min.js"></script>
    <script src="/Scripts/libs/ng-notifications-bar-master/ngNotificationsBar.min.js"></script>
    <script src="/Scripts/libs/angular-loading-bar-master/loading-bar.min.js"></script>


    <script src="/Scripts/app.js"></script>
    <script src="/Scripts/services/QuoteService.js"></script>
    <script src="/Scripts/controllers/QuoteController.js"></script>

    <link href="/Content/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/Content/ngNotificationsBar.min.css" rel="stylesheet" />
    <link href="/Content/loading-bar.min.css" rel="stylesheet" />

    <link href="/Content/Site.css" rel="stylesheet" type="text/css" />

    <script src="/Scripts/modernizr-2.6.2.js"></script>

</head>
<body>
    <div ng-controller="QuoteController as quote" class="searchcontractsform center">
        <div id="quoteButtonsArea" class="row">
            <button type="submit" ng-click="/searchContracts" class="btn btn-add">
                <i class="glyphicon glyphicon-export"></i>
                <span>back</span>
            </button>
            <button type="submit" ng-click="contracts.searchContracts(searchcontractsform)" class="btn btn-add">
                <i class="glyphicon glyphicon-export"></i>
                <span>Produce proposal</span>
            </button>
            <button type="submit" ng-click="contracts.searchContracts(searchcontractsform)" class="btn btn-add">
                <i class="glyphicon glyphicon-exclamation-sign"></i>
                <span>Generate contract</span>
            </button>
            <button type="submit" ng-click="contracts.searchContracts(searchcontractsform)" class="btn btn-add">
                <i class="glyphicon glyphicon-level-up"></i>
                <span>End state view</span>
            </button>
            <button type="submit" ng-click="contracts.searchContracts(searchcontractsform)" class="btn btn-add">
                <i class="glyphicon glyphicon-plus"></i>
                <span>Route for approval</span>
            </button>
            <button type="submit" ng-click="contracts.searchContracts(searchcontractsform)" class="btn btn-add">
                <i class="glyphicon glyphicon-copy"></i>
                <span>Copy</span>
            </button>
            <button type="submit" ng-click="contracts.searchContracts(searchcontractsform)" class="btn btn-add">
                <i class="glyphicon glyphicon-save"></i>
                <span>Save</span>
            </button>
        </div>
        <div id="quoteTopAreaPartial" class="row">
            <div class="col-lg-7" id="quoteHeaderArea">
                <fieldset>
                    <legend>Header data</legend>
                    <form name="quoteHeaderForm" ng-show="!quote.headerExpanded">
                        <div class="form-group row">
                            <label for="QUOTE_NUMBER" class="col-sm-3 form-control-label">Quote number:</label>
                            <div class="col-sm-3">
                                {{quote.quoteHeader.QUOTE_NUMBER}}
                            </div>
                            <label for="CUSTOMER_INSTALLED_AT" class="col-sm-3 form-control-label">Customer installed at:</label>
                            <div class="col-sm-3">
                                {{quote.quoteHeader.CUSTOMER_INSTALLED_AT}}
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="TOTAL_AMOUNT" class="col-sm-3 form-control-label">Total amount:</label>
                            <div class="col-sm-3">
                                {{quote.quoteHeader.TOTAL_AMOUNT}}
                            </div>
                            <label for="QUOTE_STATUS" class="col-sm-3 form-control-label">Quote status:</label>
                            <div class="col-sm-3">
                                {{quote.quoteHeader.QUOTE_STATUS}}
                            </div>
                        </div>
                    </form>
                    <form name="quoteHeaderForm" ng-show="quote.headerExpanded || quote.isNewQuote">
                        <div class="form-group row">
                            <label for="QUOTE_NUMBER" class="col-sm-2 form-control-label">Quote number:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="QUOTE_NUMBER" ng-model="quote.quoteHeader.QUOTE_NUMBER" disabled>
                            </div>
                            <label for="QUOTE_DATE" class="col-sm-2 form-control-label">Quote date:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="QUOTE_DATE" ng-model="quote.quoteHeader.QUOTE_DATE" disabled>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="QUOTE_STATUS" class="col-sm-2 form-control-label">Quote status:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="QUOTE_STATUS" ng-model="quote.quoteHeader.QUOTE_STATUS" disabled>
                            </div>
                            <label for="CUSTOMER_INSTALLED_AT" class="col-sm-2 form-control-label">Customer installed at:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="CUSTOMER_INSTALLED_AT" ng-model="quote.quoteHeader.CUSTOMER_INSTALLED_AT" required>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="CUSTOMER_SOLD_TO" class="col-sm-2 form-control-label">Customer sold to:</label>
                            <div class="col-sm-4">
                                <input type="number" class="form-control" id="CUSTOMER_SOLD_TO" ng-model="quote.quoteHeader.CUSTOMER_SOLD_TO" required>
                            </div>
                            <label for="OPPORTUNITY_NUMBER" class="col-sm-2 form-control-label">Opportunity number:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="OPPORTUNITY_NUMBER" ng-model="quote.quoteHeader.OPPORTUNITY_NUMBER" required>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="PROPOSAL_FORMAT" class="col-sm-2 form-control-label">Proposal format:</label>
                            <div class="col-sm-4">
                                <input type="number" class="form-control" id="PROPOSAL_FORMAT" ng-model="quote.quoteHeader.PROPOSAL_FORMAT" required>
                            </div>
                            <label for="AUTO_INVOICING_FLAG" class="col-sm-2 form-control-label">Auto invoicing flag:</label>
                            <div class="col-sm-4">
                                <div class="radio-inline" ng-repeat="itm in quote.AutoFlag.options">
                                    <label>
                                        <input type="radio" ng-model="quote.quoteHeader.AUTO_INVOICING_FLAG" value="{{itm.value}}">
                                        {{itm.name}}
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="START_DATE" class="col-sm-2 form-control-label">Quote start date:</label>
                            <div class="col-sm-4">
                                <input type="number" class="form-control" id="START_DATE" ng-model="quote.quoteHeader.START_DATE" disabled>
                            </div>
                            <label for="END_DATE" class="col-sm-2 form-control-label">Quote end date:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="END_DATE" ng-model="quote.quoteHeader.END_DATE" disabled>
                                <!--{{quote.quoteHeader.END_DATE}}-->
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="OPERATING_UNIT_ID" class="col-sm-2 form-control-label">Operating Unit:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="OPERATING_UNIT_ID" ng-model="quote.quoteHeader.OPERATING_UNIT_ID" required>
                            </div>
                            <label for="DURATION" class="col-sm-2 form-control-label">Duration:</label>
                            <div class="col-sm-2">
                                <input type="number" class="form-control" id="DURATION" ng-model="quote.quoteHeader.DURATION" disabled>
                            </div>
                            <div class="col-sm-2">
                                <input type="number" class="form-control" id="DURATION_UOM" ng-model="quote.quoteHeader.DURATION_UOM">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="CURRENCY_CODE" class="col-sm-2 form-control-label">Currency:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="CURRENCY_CODE" ng-model="quote.quoteHeader.CURRENCY_CODE" required>
                            </div>
                            <label for="ACV" class="col-sm-2 form-control-label">ACV:</label>
                            <div class="col-sm-4">
                                <input type="number" class="form-control" id="ACV" ng-model="quote.quoteHeader.ACV" disabled>
                                <!--{{quote.quoteHeader.ACV}}-->
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="TOTAL_AMOUNT" class="col-sm-2 form-control-label">Total amount:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="TOTAL_AMOUNT" ng-model="quote.quoteHeader.TOTAL_AMOUNT" disabled>
                                <!--{{quote.quoteHeader.TOTAL_AMOUNT}}-->
                            </div>
                            <label for="CONTRACT_ID" class="col-sm-2 form-control-label">Generated contract:</label>
                            <div class="col-sm-4">
                                <input type="number" class="form-control" id="CONTRACT_ID" ng-model="quote.quoteHeader.CONTRACT_ID" disabled>
                                <!--{{quote.quoteHeader.CONTRACT_ID}}-->
                            </div>
                        </div>






                    </form>
                </fieldset>
            </div>
            <div class="col-lg-5" id="quoteLinesArea">
                <fieldset>
                    <legend>Maintenance Lines</legend>

                    <table>
                        <tr ng-repeat="line in quote.quoteLines">
                            <td>{{ line.INVENTORY_ITEM_ID }}</td>
                            <td>{{ line.ITEM_DESCRIPTION }}</td>
                        </tr>
                    </table>


                </fieldset>
            </div>
        </div>

        <div id="quoteSubLinesArea" class="row">
            <ul id="tableTabs">
                <li id="tab1" ng-click="quote.currentTab=1" ng-class="{'active': quote.currentTab==1}"><a href="#">Main</a></li>
                <li id="tab2" ng-click="quote.currentTab=2" ng-class="{'active': quote.currentTab==2}"><a href="#">Pricing</a></li>
            </ul>
            <table st-table="quote.quoteSubLinesDisplay" st-safe-src="quote.quoteSubLines" class="table contractstable">
                <thead>
                    <tr>
                        <th ng-show="quote.currentTab==1">Covered product</th>
                        <th ng-show="quote.currentTab==1">Description </th>
                        <th ng-show="quote.currentTab==1">Instance number</th>
                        <th ng-show="quote.currentTab==1">Serial number </th>
                        <th ng-show="quote.currentTab==1">Division name </th>
                        <th ng-show="quote.currentTab==1">Quantity </th>
                        <th ng-show="quote.currentTab==1">Start date</th>
                        <th ng-show="quote.currentTab==1">End date </th>
                        <th ng-show="quote.currentTab==1">Duration</th>
                        <th ng-show="quote.currentTab==1">PO</th>
                        <th ng-show="quote.currentTab==1">Version upgrade flag </th>
                        <th ng-show="quote.currentTab==1">Latest Version </th>

                        <th ng-show="quote.currentTab==2">Total List Price</th>
                        <th ng-show="quote.currentTab==2">Total Net Price</th>
                        <th ng-show="quote.currentTab==2">Previous amount </th>
                        <th ng-show="quote.currentTab==2">Final amount</th>
                        <th ng-show="quote.currentTab==2">CPI </th>
                        <th ng-show="quote.currentTab==2">Total final after CPI</th>
                        <th ng-show="quote.currentTab==2">Contract source </th>
                        <th ng-show="quote.currentTab==2">Order source </th>
                        <th ng-show="quote.currentTab==2">Master Agreement %</th>
                        <th ng-show="quote.currentTab==2">Master Agreement source</th>
                        <th ng-show="quote.currentTab==2">Master Agreement CPI % </th>

                    </tr>
                </thead>
                <tbody>
                    <tr st-select-row="row" st-select-mode="multi" id="{{row.CONTRACT_NUMBER}}" ng-repeat="row in quote.quoteHeader.displaySublines" ng-class="{'newRow': row.isNew}">
                        <td>{{row.SUB_LINE_ID}}</td>
                        <td ng-show="quote.currentTab==1">{{row.LINE_ID}}</td>
                        <td ng-show="quote.currentTab==1">{{row.INVENTORY_ITEM_ID}}</td>
                        <td ng-show="quote.currentTab==1">{{row.ORGANIZATION_ID}}</td>
                        <td ng-show="quote.currentTab==1">{{row.START_DATE}}</td>
                        <td ng-show="quote.currentTab==1">{{row.END_DATE}}</td>
                        <td ng-show="quote.currentTab==1">{{row.INSTANCE_ID}}</td>
                        <td ng-show="quote.currentTab==2">{{row.SERIAL_NUMBER}}</td>
                        <td ng-show="quote.currentTab==2">{{row.DIVISION_CODE}}</td>
                        <td ng-show="quote.currentTab==2">{{row.QUANTITY}}</td>
                        <td ng-show="quote.currentTab==2">{{row.BILL_TO_COUNTRY}}</td>
                        <td ng-show="quote.currentTab==2">{{row.BILL_TO_CITY}}</td>
                        <td ng-show="quote.currentTab==2">{{row.BILL_TO_SITE_NAME}}</td>
                        <td ng-show="quote.currentTab==2">{{row.SHIP_TO_COUNTRY}}</td>
                        <td ng-show="quote.currentTab==2">{{row.SHIP_TO_CITY}}</td>                       
                    </tr>
                </tbody>
            </table>

        </div>
    </div>

</body>
</html>
